<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                template="./../templates/base.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="content">

        <div style="width: 380px">
            <h:graphicImage library="images" name="llave.png" />
            <h:form>


                <p:panel id="panel" header="Ingreso al Sistema">  

                    <p:messages id="msgs"/>  

                    <h:panelGrid columns="3">  
                        <h:outputLabel for="usuario" value="Usuario: *" />  
                        <p:inputText id="usuario" value="#{homeController.usuario}" required="true" label="usuario">  
                            <f:validateLength minimum="2" />  
                        </p:inputText>  
                        <p:message for="usuario" display="icon"/>  

                        <h:outputLabel for="clave" value="Contraseña: *" />  
                        <p:password id="clave" value="#{homeController.clave}" label="Contraseña" required="true" feedback="true">  
                            <f:validateLength minimum="3"/>  
                            <p:ajax update="msgclave" event="keyup" />  
                        </p:password> 
                        <p:message for="clave" id="msgclave" display="icon"/>  

                    </h:panelGrid>  

                    <p:commandButton id="btnlogin" value="Login" update="panel" action="#{homeController.ingresar()}"/> 
                    <p:commandButton id="btncancel" value="Cancelar" action="#{homeController.adminIndex()}" immediate="true" />
                </p:panel> 



            </h:form>
        </div>
    </ui:define>
</ui:composition>
